﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApp1
{
    public partial class Form2 : Form
    {
        public Form2()
        {
            InitializeComponent();
        }

        private void return_btn_Click(object sender, EventArgs e)
        {
            this.Close();
            Form1.Cform.Show();
        }

        private void Form2_Load(object sender, EventArgs e)
        {
            List<Words> list = new List<Words>();
            //将统计的数据放在list中
            string path = Form1.Cform.getPath();
            list = Form1.Cform.CountAcountAppearTimes(path);
            foreach(Words wd in list)
            {
                dataGridView1.Rows.Add(wd.getWord(),wd.getTimes());
            }
        }
    }
}
